<DOCTYPE html>
<!--HTML5 doctype-->
<html>
    <head>
        <title>巡查记录</title>
        <meta http-equiv="Content-type" content="text/html; charset=utf-8">
        <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0, user-scalable=0">
        <meta name="apple-mobile-web-app-capable" content="yes" />
        <link rel="stylesheet" type="text/css" href="../../css/jquery.mobile-1.4.0.css" />
        <link rel="stylesheet" type="text/css" href="../../css/zpdydhl_mobile.css">
        <link rel="stylesheet" type="text/css" href="../../css/mobiscroll.custom-2.6.2.min.css">
        <script type="text/javascript" src="../../js/jquery-1.8.3.min.js"></script>
        <script type="text/javascript" src="../../js/jquery.mobile-1.4.0.min.js"></script>
        <script type="text/javascript" src="../../js/zpdydhl_mobile.js"></script>
        <script type="text/javascript" src="../../js/mobiscroll.custom-2.6.2.min.js"></script>
        <style type="text/css">
            #lishi_xuncha_list_content p{
                color:#0279BD;
                margin: 3px;

            }
            #lishi_xuncha_list_content li{
                padding-left: 10px;
                padding-bottom: 5px;
            }
        </style>
    </head>
    <body>
        <div data-role="page" data-theme="c" id="page">
            
            <div id="lishi_xuncha_list_content" class="word-break:break-all">   
                <ul data-role="listview" data-theme="a" class="ui-listview ui-group-theme-a">
                    
                </ul>
            </div>

        </div>
        <script type="text/javascript">
            $(function(){
				//setHeader()
                document_type_global = "showlishixuncha";
                

                $("#go_back").live("click",function(){
                    window.location.href = "./xunchaJilu.html";
                });

				 $(".delete_one_xuncha_jilu").die().live("click",function(){
                    if(confirm("是否确定删除此条巡查记录?"))
                    {
                        var xuncha_jilu_table = $(this).parent().parent();
                        var xuncha_jilu_id = $(this).attr("xuncha_jilu_id");

                        $.ajax({
                            type: "get",
                            async: true,
                            url:server_url+"Mobile/XunchaJilu/deleteOneXunchaJilu/xuncha_jilu_id/"+xuncha_jilu_id+yiyuan_id,
                            data:{},
                            dataType: "jsonp",
                            jsonp: "callbackDeleteOneXunchaJilu",
                            jsonpCallback:"feedBackStateDeleteOneXunchaJilu",
                            error:function(mes)
                            {
                                alert("请求失败，请稍后重试");
                            },
                            success: function(result) {
                                $(xuncha_jilu_table).remove();
                            }
                        });
                    }
                });
            });

			function refreshData()
			{
				getXunchaLishi();
				$(".ui-page").show();
			}
			function getXunchaLishi()
			{
			
				$.ajax({
                    type: "get",
                    async: true,
                    url:server_url+"Mobile/XunchaJilu/getXunChaJiLu/zhuyuan_id/"+patient_info_global.zhuyuan_id+yiyuan_id,
                    data:{},
                    dataType: "jsonp",
                    jsonp: "callbackGetXunChaJiLu",
                    jsonpCallback:"feedBackStateGetXunChaJiLu",
                    error:function(mes)
                    {
                        alert("请求失败，请稍后重试");
                    },
                    success: function(result) {
                        if(result.ret=="success")
                        {
                            var str = "";
                            xuncha_info_list = result.data;
                            if(xuncha_info_list != null)
                            {
                                for (var i = 0; i < xuncha_info_list.length; i++)
                                {
                                    str+="<li class='ui-li-static ui-body-inherit ui-first-child'>";
                                    str+="<div>";
                                    str+="<span>"+xuncha_info_list[i]["xuncha_time"]+"</span>"
                                    str+="<p>";

                                    if(xuncha_info_list[i].detail!=null)
                                    {
                                        for(var j=0;j<xuncha_info_list[i]["detail"].length;j++)
                                        {
                                            str+=xuncha_info_list[i]["detail"][j]["xuncha_item_name"]+"/";
                                            if(j%4==3){
                                                str+="</p><p>"
                                            }
                                        }
                                    }
                                    str+="</p>";
                                    str+="</div>";
                                    str+="<div>";
                                    str+="<span style='float:left'>"+"护士签名:"+xuncha_info_list[i]["xuncha_hushi_name"]+"</span>"
                                    str+="<span xuncha_jilu_id='"+xuncha_info_list[i]["id"]+"' class='delete_one_xuncha_jilu' style='float:right;color:red'>"+"删除记录</span>"
                                    str+="</div>";
                                    str+="</li>";
                                }
                            }
                            $("#lishi_xuncha_list_content").find("ul").html(str);

                        }
                        else
                        {
                            alert("失败");
                        }
                    }
                });
			
			
			}
        </script>
    </body>
</html>
